package init.gao.exception;

import com.alibaba.fastjson.JSONObject;

/**
 * @author :gaolei
 * @version :v1.0
 * @projectName :GLUtil
 * @description :
 * @createDate :2021/7/7 10:15 上午
 */
public class PrintTest {
    public static void main(String[] args) {
        try {
            exception1();
        } catch (Exception e) {
            System.out.println(JSONObject.toJSONString(e));
            System.out.println(JSONObject.toJSONString(e.getMessage()));
            System.out.println(JSONObject.toJSONString(e.getCause()));
            System.out.println(JSONObject.toJSONString(e.getSuppressed()));
            System.out.println(JSONObject.toJSONString(e.getLocalizedMessage()));
            System.out.println(JSONObject.toJSONString(e.getStackTrace()));
        }
    }

    private static void exception1() {
        nullException();
    }

    private static void nullException() {
        throw new NumberFormatException();
    }
}
